package com.ruoyi.ring.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ring.mapper.RingSleepTypeMapper;
import com.ruoyi.ring.domain.RingSleepType;
import com.ruoyi.ring.service.IRingSleepTypeService;

/**
 * 睡眠类型Service业务层处理
 * 
 * @author liuwp
 * @date 2025-08-27
 */
@Service
public class RingSleepTypeServiceImpl implements IRingSleepTypeService 
{
    @Autowired
    private RingSleepTypeMapper ringSleepTypeMapper;

    /**
     * 查询睡眠类型
     * 
     * @param id 睡眠类型主键
     * @return 睡眠类型
     */
    @Override
    public RingSleepType selectRingSleepTypeById(Long id)
    {
        return ringSleepTypeMapper.selectRingSleepTypeById(id);
    }

    /**
     * 查询睡眠类型列表
     * 
     * @param ringSleepType 睡眠类型
     * @return 睡眠类型
     */
    @Override
    public List<RingSleepType> selectRingSleepTypeList(RingSleepType ringSleepType)
    {
        return ringSleepTypeMapper.selectRingSleepTypeList(ringSleepType);
    }

    /**
     * 根据业务主键查询一条记录：睡眠类型
     *
     * @param ringSleepType 睡眠类型
     * @return 睡眠类型
     */
    @Override
    public RingSleepType selectOneRingSleepType(RingSleepType ringSleepType)
    {
        return ringSleepTypeMapper.selectOneRingSleepType(ringSleepType);
    }

    /**
     * 新增睡眠类型
     * 
     * @param ringSleepType 睡眠类型
     * @return 结果
     */
    @Override
    public int insertRingSleepType(RingSleepType ringSleepType)
    {
        ringSleepType.setCreateTime(DateUtils.getNowDate());
        return ringSleepTypeMapper.insertRingSleepType(ringSleepType);
    }

    /**
     * 修改睡眠类型
     * 
     * @param ringSleepType 睡眠类型
     * @return 结果
     */
    @Override
    public int updateRingSleepType(RingSleepType ringSleepType)
    {
        return ringSleepTypeMapper.updateRingSleepType(ringSleepType);
    }

    @Override
    public int updateRingSleepTypeCondition(RingSleepType ringSleepType, RingSleepType ringSleepTypeCondition)
    {
        return ringSleepTypeMapper.updateRingSleepTypeCondition(ringSleepType, ringSleepTypeCondition);
    }

    /**
     * 批量删除睡眠类型
     * 
     * @param ids 需要删除的睡眠类型主键
     * @return 结果
     */
    @Override
    public int deleteRingSleepTypeByIds(Long[] ids)
    {
        return ringSleepTypeMapper.deleteRingSleepTypeByIds(ids);
    }

    /**
     * 删除睡眠类型信息
     * 
     * @param id 睡眠类型主键
     * @return 结果
     */
    @Override
    public int deleteRingSleepTypeById(Long id)
    {
        return ringSleepTypeMapper.deleteRingSleepTypeById(id);
    }

    /**
     * 条件删除睡眠类型
     *
     * @param ringSleepType 睡眠类型
     * @return 结果
     */
    @Override
    public int deleteRingSleepTypeByCondition(RingSleepType ringSleepType)
    {
        return ringSleepTypeMapper.deleteRingSleepTypeByCondition(ringSleepType);
    }

}
